<?php

/**
 * This file is part of the Framework03 PHP framework.
 * @package Framework03
 * @author Walter Tamboer
 */

// Let's get the root directory, this will be useful when setting all the paths.
$root = dirname(dirname(__FILE__));

// The include paths so that all application items can be found.
set_include_path(get_include_path() . PATH_SEPARATOR . $root . '/../library');

// Make sure that PHP actually shows the errors.
ini_set('display_errors', true);

// Also make sure that PHP shows startup errors.
ini_set('display_startup_errors', true);

// We want to show all errors including strict errors because we don't make mistakes.
error_reporting(E_ALL | E_STRICT);

// We want automatic loading of classes because we're lazy.
require_once 'FW/Loader.php';
FW_Loader::startAutoLoading();

// Create a new HTTP client.
$client = new FW_Http_Client('http://127.0.0.1/framework03/examples/HTTP/test.php', array('timeout' => 2));

// Set some example parameters.
$client->setParameter('param1', 'value0');
$client->setParameter('param1', 'value1'); // This overwrites the first one.
$client->setParameter('param2', 'value2');

// Do the actual request.
$response = $client->request(FW_Http_Request::GET);

echo $response->getBody();
echo '<hr /><pre>';
var_dump($response);
echo '</pre>';
